<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="f">
        <img src="1.gif" alt="熊猫" width="400px" height="600px" v-show="xm">
        <img src="2.webp" alt="兔子" width="400px" height="600px" v-show="tz">
        <br>
        <button @click="add">点我切换照片</button>
        
    </div>

    <script>

        var v = new Vue({
            el:"#f",
            data:{
                xm:true,
                tz:false,
            },
            methods:{
                add(){
                    this.xm=!this.xm
                    this.tz=!this.tz   
                }


            }



        })
    </script>

</body>
</html>